/**
 * 
 */
package any.restlet.helper;

import java.io.IOException;

import org.restlet.resource.Representation;
import org.restlet.resource.Variant;

/**
 * {@link Representation}Helper.
 * 
 * @author keke
 * @reversion $Revision: 80 $
 * @version 0.0.1
 * @see RepresentationHandler
 */
public interface RepresentationHelper {

    Object toEntity(String name, Representation representation)
            throws IOException;

    /**
     * @param name
     *            used as a key to locate the {@link RepresentationHandler} to
     *            process the <code>entity</code>.
     * @param entity
     *            entity must not be <code>null</code>
     * @param variant
     *            variant must not be <code>null</code>
     * @return {@link Representation} instance or <code>null</code> if variant
     *         is not accepted or supported.
     * @see RepresentationHandler#toRepresentation(Object, Variant)
     */
    Representation toRepresentation(String name, Object entity, Variant variant);
}
